package com.es.disped.dao.mapper;

import com.es.disped.dao.model.User;
import com.es.disped.dao.model.UserExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface UserMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @SelectProvider(type=UserSqlProvider.class, method="countByExample")
    long countByExample(UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @DeleteProvider(type=UserSqlProvider.class, method="deleteByExample")
    int deleteByExample(UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @Delete({
        "delete from user",
        "where user_id = #{userId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @Insert({
        "insert into user (user_id, username, ",
        "password, open_id, ",
        "realname, gender, ",
        "email, phone, idcard, ",
        "birthday, graduate_institution, ",
        "major, final_educational, ",
        "final_degree, begin_work, ",
        "positional_title, obtain_positional_title_time, ",
        "main_tech_subject, attached_tech_subject, ",
        "weekly_class_hours, teaching_grade, ",
        "belong_area, belong_school, ",
        "presasg, within_enterprise, ",
        "tech_year, teacher_certification, ",
        "other_work, office_call, ",
        "join_date, user_type, ",
        "user_valid)",
        "values (#{userId,jdbcType=CHAR}, #{username,jdbcType=VARCHAR}, ",
        "#{password,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, ",
        "#{realname,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, ",
        "#{email,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{idcard,jdbcType=CHAR}, ",
        "#{birthday,jdbcType=VARCHAR}, #{graduateInstitution,jdbcType=VARCHAR}, ",
        "#{major,jdbcType=VARCHAR}, #{finalEducational,jdbcType=VARCHAR}, ",
        "#{finalDegree,jdbcType=VARCHAR}, #{beginWork,jdbcType=VARCHAR}, ",
        "#{positionalTitle,jdbcType=VARCHAR}, #{obtainPositionalTitleTime,jdbcType=VARCHAR}, ",
        "#{mainTechSubject,jdbcType=VARCHAR}, #{attachedTechSubject,jdbcType=VARCHAR}, ",
        "#{weeklyClassHours,jdbcType=INTEGER}, #{teachingGrade,jdbcType=INTEGER}, ",
        "#{belongArea,jdbcType=VARCHAR}, #{belongSchool,jdbcType=VARCHAR}, ",
        "#{presasg,jdbcType=VARCHAR}, #{withinEnterprise,jdbcType=INTEGER}, ",
        "#{techYear,jdbcType=INTEGER}, #{teacherCertification,jdbcType=VARCHAR}, ",
        "#{otherWork,jdbcType=VARCHAR}, #{officeCall,jdbcType=VARCHAR}, ",
        "#{joinDate,jdbcType=VARCHAR}, #{userType,jdbcType=VARCHAR}, ",
        "#{userValid,jdbcType=INTEGER})"
    })
    int insert(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @InsertProvider(type=UserSqlProvider.class, method="insertSelective")
    int insertSelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @SelectProvider(type=UserSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="open_id", property="openId", jdbcType=JdbcType.VARCHAR),
        @Result(column="realname", property="realname", jdbcType=JdbcType.VARCHAR),
        @Result(column="gender", property="gender", jdbcType=JdbcType.INTEGER),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="idcard", property="idcard", jdbcType=JdbcType.CHAR),
        @Result(column="birthday", property="birthday", jdbcType=JdbcType.VARCHAR),
        @Result(column="graduate_institution", property="graduateInstitution", jdbcType=JdbcType.VARCHAR),
        @Result(column="major", property="major", jdbcType=JdbcType.VARCHAR),
        @Result(column="final_educational", property="finalEducational", jdbcType=JdbcType.VARCHAR),
        @Result(column="final_degree", property="finalDegree", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_work", property="beginWork", jdbcType=JdbcType.VARCHAR),
        @Result(column="positional_title", property="positionalTitle", jdbcType=JdbcType.VARCHAR),
        @Result(column="obtain_positional_title_time", property="obtainPositionalTitleTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="main_tech_subject", property="mainTechSubject", jdbcType=JdbcType.VARCHAR),
        @Result(column="attached_tech_subject", property="attachedTechSubject", jdbcType=JdbcType.VARCHAR),
        @Result(column="weekly_class_hours", property="weeklyClassHours", jdbcType=JdbcType.INTEGER),
        @Result(column="teaching_grade", property="teachingGrade", jdbcType=JdbcType.INTEGER),
        @Result(column="belong_area", property="belongArea", jdbcType=JdbcType.VARCHAR),
        @Result(column="belong_school", property="belongSchool", jdbcType=JdbcType.VARCHAR),
        @Result(column="presasg", property="presasg", jdbcType=JdbcType.VARCHAR),
        @Result(column="within_enterprise", property="withinEnterprise", jdbcType=JdbcType.INTEGER),
        @Result(column="tech_year", property="techYear", jdbcType=JdbcType.INTEGER),
        @Result(column="teacher_certification", property="teacherCertification", jdbcType=JdbcType.VARCHAR),
        @Result(column="other_work", property="otherWork", jdbcType=JdbcType.VARCHAR),
        @Result(column="office_call", property="officeCall", jdbcType=JdbcType.VARCHAR),
        @Result(column="join_date", property="joinDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_valid", property="userValid", jdbcType=JdbcType.INTEGER)
    })
    List<User> selectByExample(UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @Select({
        "select",
        "user_id, username, password, open_id, realname, gender, email, phone, idcard, ",
        "birthday, graduate_institution, major, final_educational, final_degree, begin_work, ",
        "positional_title, obtain_positional_title_time, main_tech_subject, attached_tech_subject, ",
        "weekly_class_hours, teaching_grade, belong_area, belong_school, presasg, within_enterprise, ",
        "tech_year, teacher_certification, other_work, office_call, join_date, user_type, ",
        "user_valid",
        "from user",
        "where user_id = #{userId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="open_id", property="openId", jdbcType=JdbcType.VARCHAR),
        @Result(column="realname", property="realname", jdbcType=JdbcType.VARCHAR),
        @Result(column="gender", property="gender", jdbcType=JdbcType.INTEGER),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="idcard", property="idcard", jdbcType=JdbcType.CHAR),
        @Result(column="birthday", property="birthday", jdbcType=JdbcType.VARCHAR),
        @Result(column="graduate_institution", property="graduateInstitution", jdbcType=JdbcType.VARCHAR),
        @Result(column="major", property="major", jdbcType=JdbcType.VARCHAR),
        @Result(column="final_educational", property="finalEducational", jdbcType=JdbcType.VARCHAR),
        @Result(column="final_degree", property="finalDegree", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_work", property="beginWork", jdbcType=JdbcType.VARCHAR),
        @Result(column="positional_title", property="positionalTitle", jdbcType=JdbcType.VARCHAR),
        @Result(column="obtain_positional_title_time", property="obtainPositionalTitleTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="main_tech_subject", property="mainTechSubject", jdbcType=JdbcType.VARCHAR),
        @Result(column="attached_tech_subject", property="attachedTechSubject", jdbcType=JdbcType.VARCHAR),
        @Result(column="weekly_class_hours", property="weeklyClassHours", jdbcType=JdbcType.INTEGER),
        @Result(column="teaching_grade", property="teachingGrade", jdbcType=JdbcType.INTEGER),
        @Result(column="belong_area", property="belongArea", jdbcType=JdbcType.VARCHAR),
        @Result(column="belong_school", property="belongSchool", jdbcType=JdbcType.VARCHAR),
        @Result(column="presasg", property="presasg", jdbcType=JdbcType.VARCHAR),
        @Result(column="within_enterprise", property="withinEnterprise", jdbcType=JdbcType.INTEGER),
        @Result(column="tech_year", property="techYear", jdbcType=JdbcType.INTEGER),
        @Result(column="teacher_certification", property="teacherCertification", jdbcType=JdbcType.VARCHAR),
        @Result(column="other_work", property="otherWork", jdbcType=JdbcType.VARCHAR),
        @Result(column="office_call", property="officeCall", jdbcType=JdbcType.VARCHAR),
        @Result(column="join_date", property="joinDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_type", property="userType", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_valid", property="userValid", jdbcType=JdbcType.INTEGER)
    })
    User selectByPrimaryKey(String userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @UpdateProvider(type=UserSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @UpdateProvider(type=UserSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @UpdateProvider(type=UserSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user
     *
     * @mbg.generated Wed Jun 19 20:23:58 CST 2019
     */
    @Update({
        "update user",
        "set username = #{username,jdbcType=VARCHAR},",
          "password = #{password,jdbcType=VARCHAR},",
          "open_id = #{openId,jdbcType=VARCHAR},",
          "realname = #{realname,jdbcType=VARCHAR},",
          "gender = #{gender,jdbcType=INTEGER},",
          "email = #{email,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "idcard = #{idcard,jdbcType=CHAR},",
          "birthday = #{birthday,jdbcType=VARCHAR},",
          "graduate_institution = #{graduateInstitution,jdbcType=VARCHAR},",
          "major = #{major,jdbcType=VARCHAR},",
          "final_educational = #{finalEducational,jdbcType=VARCHAR},",
          "final_degree = #{finalDegree,jdbcType=VARCHAR},",
          "begin_work = #{beginWork,jdbcType=VARCHAR},",
          "positional_title = #{positionalTitle,jdbcType=VARCHAR},",
          "obtain_positional_title_time = #{obtainPositionalTitleTime,jdbcType=VARCHAR},",
          "main_tech_subject = #{mainTechSubject,jdbcType=VARCHAR},",
          "attached_tech_subject = #{attachedTechSubject,jdbcType=VARCHAR},",
          "weekly_class_hours = #{weeklyClassHours,jdbcType=INTEGER},",
          "teaching_grade = #{teachingGrade,jdbcType=INTEGER},",
          "belong_area = #{belongArea,jdbcType=VARCHAR},",
          "belong_school = #{belongSchool,jdbcType=VARCHAR},",
          "presasg = #{presasg,jdbcType=VARCHAR},",
          "within_enterprise = #{withinEnterprise,jdbcType=INTEGER},",
          "tech_year = #{techYear,jdbcType=INTEGER},",
          "teacher_certification = #{teacherCertification,jdbcType=VARCHAR},",
          "other_work = #{otherWork,jdbcType=VARCHAR},",
          "office_call = #{officeCall,jdbcType=VARCHAR},",
          "join_date = #{joinDate,jdbcType=VARCHAR},",
          "user_type = #{userType,jdbcType=VARCHAR},",
          "user_valid = #{userValid,jdbcType=INTEGER}",
        "where user_id = #{userId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(User record);
}